﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace Medora.DataContract
{
    public interface IAsyncRepository<T> where T : class
    {
        
        void AddSave(T obj);
        
        T GetById(Guid id);
        
        IEnumerable<T> Get(Expression<Func<T, bool>> filter = null, Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null, string includeProperties = "");
        
        void UpdateSave(T entity);
        
        void OneFieldUpdateSave(T entity, Expression<Func<T, int>> field);

        IEnumerable<T> GetTake(int takeSize, Expression<Func<T, bool>> filter = null, Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null, string includeProperties = "");
    }
}